package com.atguigu.spzx.user.controller;

import com.atguigu.spyx.model.common.Result;
import com.atguigu.spzx.user.service.SmsService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author LT
 * @create 2023-11-19-22:33
 */
@RestController
@RequestMapping("/api/user/sms")
public class SmsController {

    @Resource
    SmsService smsService;

    @GetMapping("/sendCode/{phone}")
    public Result sendMsg(@PathVariable("phone")String phone,
                          Integer type){
        smsService.sendMsg(phone,type);
        return Result.ok();
    }
}
